﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SystemCenterSoa.ApiProject.Area.SystemManager;
using SystemCenterSoa.DtoModel.Common;
using SystemCenterSoa.PoModel.SystemSettings.CommonlyUsedSettings;
using SystemCenterSoa.Service.SystemSettings.CommonlyUsedSettings;

namespace SystemCenterSoa.ApiProject.Area.SystemSettings.CommonlyUsedSettings
{
     [AllowAnonymous]  //不验证登录
    public class DictionaryInstallController : SystemManagerBaseController
    {

        private DictionaryInstallService _dictionaryInstallService;

        public DictionaryInstallController(DictionaryInstallService dictionaryInstallService)
        {
            _dictionaryInstallService = dictionaryInstallService;
        }

        [HttpPost]
        public ResultModel<int> DictionaryInstallAdd(DictionaryInstallPo info)
        {
            var data = _dictionaryInstallService.DictionaryInstallAdd(info);
            return MyOk(data);
        }

        [HttpGet]
        public ResultModel<DictionaryInstallPo> DictionaryInstallEdit(int id)
        {
            var data = _dictionaryInstallService.DictionaryInstallEdit(id);
            return MyOk(data);
        }

        [HttpPost]
        public ResultModel<int> DictionaryInstallUpdate(DictionaryInstallPo info)
        {
            var data=_dictionaryInstallService.DictionaryInstallUpdate(info);
            return MyOk(data);
        }

        [HttpPost]
        public ResultModel<PagerResult<DictionaryInstallPo>> SearchPage(SearchModel searchmodel)
        {
          var data=_dictionaryInstallService.SearchPage(searchmodel);
            return MyOk(data);
        }


        [HttpGet]
        //获取下拉
        public ResultModel<List<DictionaryInstallPo>> GetDropDown()
        {
            var data=_dictionaryInstallService.GetDropDown();
            return MyOk(data);
        }

        [HttpPost]
        public ResultModel<int> DictionaryInstallDelete(List<int> ids)
        {
            var data = _dictionaryInstallService.DictionaryInstallDelete(ids);
            return MyOk(data);
        }

    }
}
